<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ユーザ追加</title>
<link rel="stylesheet" href="css/cf.css">
<!-- Google hosting Jquery  http://blog.fkoji.com/2009/01142136.html-->
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"
	type="text/javascript"></script>
<script src="js/cf.js" type="text/javascript"></script>
<script src="js/lib/jquery.cookie.js" type="text/javascript"></script>
<!-- メインスクリプト-->
<script type="text/javascript">
	var applet = null;
	var errflg = false;
	var sender = new cf();
	function appletReader(loadLimit) {
		try {
			applet = document.felicaHeadlessApplet;
			applet.getAppletName();
			errflg = false;
		} catch (err) {
			errflg = true;
		}
		if (errflg) {
			if (loadLimit <= 0)
				return;
			loadLimit--;
			window.setTimeout(appletReader, 1000, loadLimit);
		} else {
		}
	}

	appletReader(15);

	function loadIdm() {
		var idm = applet.getIDm();
		$("#idm").val(idm);
	}
	function sendData() {
		var idm = $("#idm").val();
		var uname = $("#uname").val();
		if (!idm||idm=='') {
			alert("IDが取得できていません。");
			return;
		}
		if (!uname||uname=='') {
			alert("ユーザ名が入力されていません。");
			return;
		}
		//POST
		sender.regis(idm, uname);
	}
</script>
</head>
<body>
	<div class="title">Coffee＊ユーザ登録</div>
	<div class="fbox">
		<div>
			名前&nbsp;<input id="uname" type="text" class='ta' name="n">
		</div>
		<div>
			ＩＤＭ&nbsp;<input id="idm" type="text" class='ta' name="id">
			<button class="btn" onclick="loadIdm()">ID取得</button>
		</div>
		<button class="btn" id='sa' onclick='sendData()' >ユーザ登録</button>
	</div>
	<applet alt="Headless Applet" name="felicaHeadlessApplet"
		code="com.googlecode.felicalib.sample.applet.FelicaHeadlessApplet"
		width="1" height="1">
		<param name="draggable" value="true">
		<param name="jnlp_href" value="FelicalibSampleApplet.jnlp">
	</applet>
</body>
</html>